package com.csnf.controller;


import com.csnf.dto.ResponseObject;
import com.csnf.entity.MerchantAccount;
import com.csnf.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController()
@RequestMapping("/admin")
public class AdminMerchantExamineController {

    @Autowired
    private AdminService adminService;

    @RequestMapping("/selectAllExamineMerchant")
    public ResponseObject selectAllExamineMerchant(){
        ArrayList<MerchantAccount> list = adminService.selectAllExamineMerchant();
        System.out.println(list);
        if (list.size()>0){
            return ResponseObject.success("查询成功",list);
        }else {
            return ResponseObject.success("数据为空");
        }
    }

    @RequestMapping("/selectAllByStatus")
    public ResponseObject selectAllByStatus(){
        ArrayList<MerchantAccount> list = adminService.selectAllByStatus();
        if (list.size()>0){
            return ResponseObject.success("查询成功",list);
        }else {
            return ResponseObject.success("数据为空");
        }
    }

}
